import React from "react";
import { Button } from 'antd';
interface Props {
  name: string;
  age?: number;
  callBack: (params: string) => void;
  callBack1: (params: string) => void;
}
const defaultProps = {
  age: 20
};
const Child:React.FC<Props> = (props) => {
  const { name: name1, age } = { ...defaultProps, ...props };
  const handleEditSex = () => {
    props.callBack('正在修改性别');
  };
  const handleEditSex1 = () => {
    props.callBack1('正在修改性别1');
  };
  return (
    <div>
      <div>{name1}</div>
      <div>{age}</div>
      <Button type="primary" onClick={handleEditSex}>改性别</Button>
      <Button type="primary" onClick={handleEditSex1}>改性别1</Button>
    </div>
  );
};
export default Child;